package dt.inlee.common.tools;
import java.text.SimpleDateFormat;
import java.util.Date;

public class AutoCode {
	public static String employeeCode(int key)
	{
		return String.format("%08d", key% 100000);
	}
	public static String QuoteCode(String profix, int key)
	{
		return profix+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%04d", key% 10000);
	}
	public static String CustomerQuoteCode(int key)
	{
		return "BJ"+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%04d", key% 10000);
	}
	public static String OrderCode(int key)
	{
		return "SJ"+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%04d", key% 10000);
	}
	public static String OrderCode2(int key)
	{
		return String.format("%08d", key% 100000);
	}
	public static String GoodsListCode(int id, int key)
	{
		return "DF"+new SimpleDateFormat("yyMMdd").format(new Date())+String.format("%05d", id)+String.format("%04d", key % 10000);
	}
	public static String DutyIdentityCode(int key)
	{
		return "ZR"+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%03d", key% 1000);
	}
	public static String ProblemsCode(int key)
	{
		return "WT"+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%03d", key% 1000);
	}
	public static String PrepaidRecordCode(String id, int key)
	{
		return "SK"+new SimpleDateFormat("yyMMdd").format(new Date())+id+key;
	}
	public static String CostRecordCode(int key)
	{
		return "FK"+new SimpleDateFormat("yyMMdd").format(new Date())+String.format("%04d", key% 10000);
	}
	public static String EmployeeCode(int key)
	{
		return String.format("%04d", key% 10000);
	}
	public static String ProductTypeCode(int key)
	{
		return "FK"+String.format("%04d", key% 10000);
	}
	public static String PackageCode(String ChannelCode, String CountryCode, int key)
	{
		return ChannelCode+new SimpleDateFormat("yyMMdd").format(new Date())+CountryCode+String.format("%02d", key%100);
	}
	public static String CarryBatCode(String ChannelCode, String carryBatCode, int key){
		return "CH"+ChannelCode+new SimpleDateFormat("yyMMdd").format(new Date())+carryBatCode+String.format("%04d", key% 10000);
	}
	
	public static String AssignFetchCode(int key)
	{
		return "QJ"+new SimpleDateFormat("yyyyMMdd").format(new Date())+String.format("%04d", key% 10000);
	}
	
	public static String SingleCode(String profix, int key)
	{
		return profix+String.format("-%02d", key% 10000);
	}
	public static Integer CardDataCode(int key) {
		return key;
	}

}
